package com.wang.wangapiclientsdk.utils;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

public class SignUtil {
    /**
     * 生成签名
     * @param body 用户参数
     * @param secretKey 密钥 sk
     * @return 签名
     */
    public static String genSign(String body, String secretKey) {
        Digester digester = new Digester(DigestAlgorithm.SHA256);
        String content = body.toString() + "." + secretKey;
        return digester.digestHex(content);
    }
}
